package com.longtxt.core.ble.impl

import android.app.Notification
import android.app.PendingIntent
import android.content.Context
import com.longtxt.core.ble.model.BaseBleResponse
import com.longtxt.core.ble.model.Health
import com.longtxt.core.ble.BlueEventState
import com.longtxt.core.ble.model.BoundDevice
import com.longtxt.core.ble.model.Daily
import com.longtxt.core.ble.model.DeviceItem
import kotlinx.coroutines.flow.MutableStateFlow
import java.io.File

internal interface BleRepository {
    var connectState: MutableStateFlow<BlueEventState>
    var bandConfig: BoundDevice
    var isJLieWatch: Boolean
    var baseFileUrl: File
    var notificationFlag: Int
    var isManualConnect: Boolean
    var isRoundWatch: Boolean
    var isSpecialWatch: Boolean
    var notification: Notification

    fun initializeSdk(
        context: Context, channelId: String,
        channelName: String,
        contentTitle: String,
        contentText: String,
        smallIcon: Int,
        pendingIntent: PendingIntent
    )

    fun starBleService(context: Context, needForeService: Boolean,)
    fun connectBleDevice(
        device: DeviceItem,
        needBond: Boolean,
        timeoutMs: Long,
        resp: (BaseBleResponse<Boolean>) -> Unit
    )

    fun startConnectBle()
    fun bleStateToConnected()
    fun bleStateToDisconnected()
    fun getBandConfig()
    fun getUserInfo()
    fun getSupportedFunc()
    fun changeNotifySetting(value: Int)
    fun getExamineData()
    fun getSportData(day: Int)
    fun getSoftVersion()
    fun postOSPlatform(data: Byte, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postLanguage(data: ByteArray, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postFindBand(response: (BaseBleResponse<Boolean>) -> Unit)
    fun postBandReset(response: (BaseBleResponse<Boolean>) -> Unit)
    fun postAlarm(data: ByteArray, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postAntiLost(on: Boolean, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postHeartRate(data: ByteArray, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postLightUp(on: Boolean, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postScreenSaverInterval(data: ByteArray, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postTimeFormat(data: Byte)
    fun postUserInfo(data: ByteArray, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postWeather(data: ByteArray, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postCameraState(isOn: Boolean, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postScreenStart(data: ByteArray, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postScreenData(data: ByteArray, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postMarketScreenStart(data: ByteArray, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postMarketScreenData(data: ByteArray, response: (BaseBleResponse<Boolean>) -> Unit)
    fun postScreenParams(data: ByteArray)
    fun writeCommandData(data: ByteArray)

    fun getHeadSetMacAddress(response: (BaseBleResponse<ByteArray>) -> Unit)
    fun postInitialConnection(isInitial: Boolean)
    fun disconnect()
    fun setCameraShakeListener(listener: (Boolean) -> Unit)
    fun removeCameraShakeListener()
    fun setFindPhoneListener(listener: (Boolean) -> Unit)
    fun removeFindPhoneListener()
    fun setCameraOpenListener(listener: (Boolean) -> Unit)
    fun removeCameraOpenListener()
    fun setDailyDataListener(listener: (BaseBleResponse<Daily>) -> Unit)
    fun removeDailyDataListener()
    fun setCallControlListener(listener: (Boolean) -> Unit)
    fun addBleLogListener(listener: (String) -> Unit)
    fun updateBondDevice(name: String, mac: String)
    fun switchFixedWatch(type: Int, response: (BaseBleResponse<Boolean>) -> Unit)
    fun stopBleScan()
    fun resetBleState()
    fun setWeatherRequestListener(listener: () -> Unit)
    fun setHealthDataListener(listener: (BaseBleResponse<Health>) -> Unit)
}
